package com.top10.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.top10.entity.Rebate;
import com.top10.entity.Rebatelink;
import com.top10.mapper.RebateLinkMapper;
import com.top10.mapper.RebateMapper;
import com.top10.service.RebateLinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class RebateLinkServiceImpl implements RebateLinkService {


	@Autowired
	RebateLinkMapper rebateLinkMapper;
	@Autowired
	RebateMapper rebateMapper;

	@Override
	public List<Rebatelink> getLinkOne()throws Exception{
       return  rebateLinkMapper.getLinkOne();
	}

	@Override
	public List<Rebatelink> getLinkTwo()throws Exception{
		return  rebateLinkMapper.getLinkTwo();
	}

	@Override
	public List<Rebate> getPersonal(String uuid)throws Exception{
		return rebateMapper.selectList(new EntityWrapper<Rebate>().eq("tuser_uuid",uuid).eq("rebate_shoptype",4));
	}

	@Override
	public List<Rebate> getBusiness(String uuid)throws Exception{
		return rebateMapper.selectList(new EntityWrapper<Rebate>().eq("tuser_uuid",uuid).ne("rebate_shoptype",4));
	}
	@Override
	public List<Rebate> getPersonalOne(String uuid)throws Exception{
		return rebateMapper.selectList(new EntityWrapper<Rebate>().eq("puser_uuid",uuid));
	}
	@Override
	public List<Rebate> getPersonalTwo(String uuid)throws Exception{
		return rebateMapper.selectList(new EntityWrapper<Rebate>().eq("ruser_uuid",uuid));
	}

	@Override
	public  List<Rebate> getRebate(String ruser_uuid)throws Exception{
		return rebateMapper.selectRebate(ruser_uuid);
	}
	@Override
	public List<Rebate> getRebateOne(String puser_uuid)throws Exception{
		return rebateMapper.selectRebateOne(puser_uuid);
	}

}
